﻿//全选CheckBox必须命名为ckbAll，明细CheckBox必须命名为ckbItem，并且页面上其它元素不要使用这两个命名*/
function ChooseAll(varDocument) 
{
    var flagCheck = true;
    var inputs = varDocument.all.tags("INPUT");     
    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAll") > 0 ) 
        { 
            flagCheck = inputs[j].checked; 
            break;
        } 
    } 
    if(flagCheck == true ) 
    { 
    inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0 ) 
            { 
                inputs[i].checked = true; 
            } 
        } 
        flagCheck = false; 
    } 
    else 
    { 
        inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0 ) 
            { 
                inputs[i].checked = false; 
            } 
        } 
        flagCheck = true; 
    }
}

function ChooseAllVlaues(varDocument, hidid) {

    var values = document.getElementById(hidid);
    values.value = "";
   
    var flagCheck = true;
    var inputs = varDocument.all.tags("INPUT");
    for (var j = 0; j < inputs.length; j++) {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAll") > 0) {
            flagCheck = inputs[j].checked;
            break;
        }
    }
    if (flagCheck == true) {
        inputs = varDocument.all.tags("INPUT");
        for (var i = 0; i < inputs.length; i++) {
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0) {
                inputs[i].checked = true;
                values.value += inputs[i].value + "$$";
            }
        }
        flagCheck = false;
    }
    else {
        inputs = varDocument.all.tags("INPUT");
        for (var i = 0; i < inputs.length; i++) {
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0) {
                inputs[i].checked = false;
            }
        }
        flagCheck = true;
    }

}
function ChooseAll_CPM(varDocument) 
{
    var flagCheck = true;
    var inputs = varDocument.all.tags("INPUT");     
    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbCPMAll") > 0 ) 
        { 
            flagCheck = inputs[j].checked; 
            break;
        } 
    } 
    if(flagCheck == true ) 
    { 
    inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbCPMItem") > 0 ) 
            { 
                inputs[i].checked = true; 
            } 
        } 
        flagCheck = false; 
    } 
    else 
    { 
        inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbCPMItem") > 0 ) 
            { 
                inputs[i].checked = false; 
            } 
        } 
        flagCheck = true; 
    } 
}
function ChooseAll_Admin(varDocument) 
{
    var flagCheck = true;
    var inputs = varDocument.all.tags("INPUT");     
    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAdminAll") > 0 ) 
        { 
            flagCheck = inputs[j].checked; 
            break;
        } 
    } 
    if(flagCheck == true ) 
    { 
    inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbAdminItem") > 0 ) 
            { 
                inputs[i].checked = true; 
            } 
        } 
        flagCheck = false; 
    } 
    else 
    { 
        inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbAdminItem") > 0 ) 
            { 
                inputs[i].checked = false; 
            } 
        } 
        flagCheck = true; 
    }
}
function CancelChooseAllVlaues(varDocument, hidid) {

    var isChecked = true;
    var inputs = varDocument.all.tags("INPUT");
    var values = document.getElementById(hidid);

    values.value = "";
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0) {
            isChecked &= inputs[i].checked;
            if (inputs[i].checked) {
                values.value += inputs[i].value + "$$";
            }
        }
    }

    for (var j = 0; j < inputs.length; j++) {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAll") > 0) {
            inputs[j].checked = isChecked;
            break;
        }
    }

}

function CancelChooseAll(varDocument)
{
    var isChecked = true;
    var inputs = varDocument.all.tags("INPUT"); 
    for (var i=0; i < inputs.length; i++)
    { 
        if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbItem") > 0) 
        { 
            isChecked &= inputs[i].checked; 
        }
    } 

    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAll") > 0 ) 
        { 
            inputs[j].checked = isChecked; 
            break;
        } 
    }
}
function CancelChooseAll_CPM(varDocument)
{
    var isChecked = true;
    var inputs = varDocument.all.tags("INPUT"); 
    for (var i=0; i < inputs.length; i++)
    { 
        if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbCPMItem") > 0) 
        { 
            isChecked &= inputs[i].checked; 
        }
    } 

    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbCPMAll") > 0 ) 
        { 
            inputs[j].checked = isChecked; 
            break;
        } 
    }
}
function CancelChooseAll_Admin(varDocument)
{
    var isChecked = true;
    var inputs = varDocument.all.tags("INPUT"); 
    for (var i=0; i < inputs.length; i++)
    { 
        if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf("ckbAdminItem") > 0) 
        { 
            isChecked &= inputs[i].checked; 
        }
    } 

    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf("ckbAdminAll") > 0 ) 
        { 
            inputs[j].checked = isChecked; 
            break;
        } 
    }
}


//重载选择方法，传入Item项id*/
function ChooseAllByParam(varDocument,allCtr,itemCtr) 
{
    var flagCheck = true;
    var inputs = varDocument.all.tags("INPUT");     
    for(var j=0; j<inputs.length; j++)
    {    
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf(allCtr) >= 0 ) 
        { 
            flagCheck = inputs[j].checked;            
            break;
        } 
    } 
    if(flagCheck == true ) 
    { 
    inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf(itemCtr) > 0 && inputs[i].disabled == false) 
            { 
                inputs[i].checked = true; 
            } 
        } 
        flagCheck = false; 
    } 
    else 
    { 
        inputs = varDocument.all.tags("INPUT"); 
        for (var i=0; i < inputs.length; i++) 
        { 
            if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf(itemCtr) > 0 && inputs[i].disabled == false ) 
            { 
                inputs[i].checked = false; 
            } 
        } 
        flagCheck = true; 
    } 
} 
function CancelChooseAllByParam(varDocument,allCtr,itemCtr)
{
    var isChecked = true;
    var inputs = varDocument.all.tags("INPUT"); 
    for (var i=0; i < inputs.length; i++)
    { 
        if (inputs[i].type == "checkbox" && inputs[i].id.lastIndexOf(itemCtr) > 0) 
        { 
            isChecked &= inputs[i].checked; 
        }
    } 

    for(var j=0; j<inputs.length; j++)
    {
        if (inputs[j].type == "checkbox" && inputs[j].id.lastIndexOf(allCtr) >= 0 ) 
        { 
            inputs[j].checked = isChecked; 
            break;
        } 
    }
}

/*验证合法长度*/
function ValidateLength(oSrc, args)
{
    if(args.Value != "")
    {
        args.IsValid = (GetByteLength(args.Value) <= oSrc["limit"]); 
    }
}

function GetByteLength(str)
{
	var iLen = 0;
	for(i = 0; i < str.length; i ++)
	{
		iLen += 1;
	}
	return iLen;
}

/****************************************************
function:Trim(InputCtr)
description:字符串去空格的函数（任何位置）
return value:去掉空格的字符串
****************************************************/
function Trim(InputCtr)
{
    var sInputString = InputCtr.value;
    var sTmpStr = ' ';
    var result = '';
    for(var i=0; i<sInputString.length; i++)
    {
        sTmpStr = sInputString.substr(i,1);
        if(sTmpStr != ' ')
        {
            result = result + sTmpStr;
        }
    } 
    InputCtr.value = result;
}

/****************************************************
function:CheckValue(id,msg,type)
description:验证至少选中页面列表中的一条记录（以便进行其它删除等操作）
return value:true or false
****************************************************/
function CheckValue(id,msg,type)
{
    var isSelect = false;
    
	var e = document.all.tags("input");
	for (var i=0;i<e.length;i++)
    {
	   if (e[i].type==type && e[i].checked == true && e[i].id.lastIndexOf(id) >= 0)
	   {
	       isSelect = true;
		   break;
	   }
    }
    if(!isSelect)
    {
        alert(msg);
        return false;
    }
    else
    {
        return true;
    }
}


/****************************************************
function:CheckIsSelectedAndConfirm(id,msg1,msg2,type)
description:验证至少选中页面列表中的一条记录并提示客户确认删除（以便进行真正删除等操作）
return value:true or false
****************************************************/
function CheckIsSelectedAndConfirm(id,msg1,msg2,type)
{    
	if(CheckValue(id,msg1,type))
	{
	  return  confirm(msg2);
	}
	else
	{
	   return false;
	}
}
/****************************************************
function:CheckOneValue(id,msg,type)
description:验证只能选中页面列表中的一条记录（以便进行其它删除等操作）
return value:true or false
****************************************************/
function CheckOneValue(id,msg,type)
{
    var count = 0;
    var e = document.all.tags("input");
	for (var i=0;i<e.length;i++)
    {
	   if (e[i].type == type && e[i].checked == true && e[i].id.lastIndexOf(id) >= 0)
	   {
	       count++;
	       if(count > 1)
	       {
	            break;
	       }
	   }
    }
    if(count != 1)
    {
        alert(msg);
        return false;
    }
    else
    {
        return true;
    }
}
/****************************************************
function:FormatAmount(InputCtr,digit)
description:格式化输入的数字为金额格式（InputCtr为需要设置的控件，digit为小数点位数）
****************************************************/
function FormatAmount(InputCtr,digit)
{
    if (!isInnerFloat(InputCtr.value))
    {
        InputCtr.value = "";
        return 
    } 
    var strData = InputCtr.value;
 	if(isInnerFloat(strData))
 	{
 		if(strData!="")
 		{
			var i,strTemp;
			strTemp=new String(strData);
			strData="";
			for(i=0;i<strTemp.length;i++)
			{
				var cData;
				cData=strTemp.charAt(i);
				if (cData!=",")
				{
					strData=strData+cData;
				}
			}			
	 		var nPoint;
	 		nPoint=strData.indexOf(".");
	 		var strFront=strData,strEnd="";
	 		if(nPoint!=-1)
	 		{
	 			strFront=strData.substring(0,nPoint);
	 			strEnd=strData.substring(nPoint+1,strData.length);
	 		}			
			strTemp=new String(strFront);
			var bHaveMinus=false;
			if(strFront.substring(0,1)=="-")
			{
				bHaveMinus=true;
				strTemp=strTemp.substring(1,strTemp.length);
			}
			strFront="";
			var nNum;
			nNum=0;
			for(i=strTemp.length-1;i>=0;i--)
			{
				if(nNum==3)
				{
					strFront=","+strFront ;
					nNum=0;
				}
				nNum++;
				var cData;
				cData=strTemp.charAt(i);
				strFront=cData+strFront;
			}
			if(bHaveMinus)
			{
				strFront="-" + strFront;
			}
			
			if(strEnd.length > digit)
			{
				strEnd = strEnd.substring(0,digit);
			}
			else
			{
				while(strEnd.length < digit)
				{
					strEnd = strEnd + "0";
				}
			}
	 		strData=strFront+"." + strEnd;
 		}
	}
 	InputCtr.value = strData;
 }
 
function isInnerFloat( d_float)
{
	if(isNaN(parseFloat(d_float)))
	  return false;
	else
	  return true;
}
/****************************************************
function:ReverseFormatAmount(InputData)
description:金额格式的数字转为普通数字（InputCtr为需要设置的控件）
****************************************************/
 function ReverseFormatAmount(InputData)
 {
    var strData  = InputData.value;
	var i,strTemp;	
	strTemp=new String(strData);
	strData = "";
	for(i=0;i<strTemp.length;i++)
	{
		var cData;
		cData=strTemp.charAt(i);
		if (cData!=",")
		{
			strData=strData+cData;
		}
	}
	InputData.value = strData;
 }
 
/*呆账理由填写 by acns 12-19*/
function OpenBadDebt(urlPrex,txtReasone)
{
	var url=urlPrex + "Common/Selector/BadDebtReasone.aspx?txtReasone=" + txtReasone ;
	OpenDialog(url, "250", "600")
}

/*选择备件借用单
**/
function OpenSelectBorrowTransItemDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectBorrowTransItem.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择备件借用项
**/
function OpenSelectReturnItemForReturnSPDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectReturnItemForReturnSP.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择备件借用项
**/
function OpenSelectReturnItemForReturnSPDialogWithSubCate(BaseUrl,ctrId,filt,SubCate)
{
	var url = BaseUrl+"Common/Selector/SelectReturnItemForReturnSP.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt + "&SubCate=" + SubCate;
	OpenDialog(url, "480", "600")
}

/*选择备件借用单
**/
function OpenSelectBorrowDocForRenewDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectBorrowDocForRenew.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择送修单（RMD返修单）
**/
function OpenSelectSendRepairDialog(BaseUrl,NOCtr,CDCtr,NameCtr,SeriesCtr)
{
	var url = BaseUrl+"Common/Selector/SelectSendRepair.aspx?rdm=" + Math.random() + 
		"&NOCtr=" + NOCtr+"&CDCtr="+CDCtr+"&NameCtr="+NameCtr+"&SeriesCtr="+SeriesCtr;
	OpenDialog(url, "480", "600")
}
/*选择送修单（RMD返修单）
**备件小分类过滤
**/
function OpenSelectSendRepairDialogWithSubCate(BaseUrl,NOCtr,CDCtr,NameCtr,SeriesCtr,SubCate)
{
	var url = BaseUrl+"Common/Selector/SelectSendRepair.aspx?rdm=" + Math.random() + 
		"&NOCtr=" + NOCtr+"&CDCtr="+CDCtr+"&NameCtr="+NameCtr+"&SeriesCtr="+SeriesCtr + "&SubCate=" + SubCate;
	OpenDialog(url, "480", "600")
}


/*选择备件扫描
**/
function OpenSelectBatchScanItemDialog(BaseUrl,IdCtr,filt,IsSend)
{
	var url = BaseUrl+"Common/Selector/SelectBatchScanItem.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + IdCtr+"&filt="+filt+"&IsSend="+IsSend;
	OpenDialog(url, "480", "600")
}

/*选择备件扫描(带库位)
**/
function OpenSelectBatchScanWithLocationItemDialog(BaseUrl,IdCtr,filt,IsSend)
{
	var url = BaseUrl+"Common/Selector/SelectBatchScanWithLocationItem.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + IdCtr+"&filt="+filt+"&IsSend="+IsSend;
	OpenDialog(url, "480", "600")
}

/*选择备件扫描(带库位)
**IsClose表示如果为关闭按钮，则返回父页面标记值
**/
function OpenSelectBatchScanWithLocationItemDialogIsClose(BaseUrl,IdCtr,filt,IsSend,IsClose)
{
	var url = BaseUrl+"Common/Selector/SelectBatchScanWithLocationItem.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + IdCtr+"&filt="+filt+"&IsSend="+IsSend+"&IsClose="+IsClose;
	OpenDialog(url, "480", "600")
}

/*选择备件小分类
**/
function OpenSelectSpSubCategoryDialog(BaseUrl,IdCtr)
{
	var url = BaseUrl+"Common/Selector/SelectSpSubCategory.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + IdCtr;
	OpenDialog(url, "480", "600")
}

/*选择备件需求
**/
function OpenSelectSPReqDialog(BaseUrl,NoCtr,IdCtr)
{
	var url = BaseUrl+"Common/Selector/SelectSPReq.aspx?rdm=" + Math.random() + 
		"&NoCtr=" + NoCtr+"&IdCtr="+IdCtr;
	OpenDialog(url, "480", "600")
}

/*选择备件需求及所属备件小分类
**/
function OpenSelectSPReqAndSPDialog(BaseUrl,NoCtr,IdCtr,SP_SUBCTGY_IDCtr,SP_CTGY_NMCtr,SP_SUBCTGY_NMCtr)
{
	var url = BaseUrl+"Common/Selector/SelectSPReq.aspx?rdm=" + Math.random() + 
		"&NoCtr=" + NoCtr+"&IdCtr="+IdCtr+"&SP_SUBCTGY_IDCtr="+SP_SUBCTGY_IDCtr+"&SP_CTGY_NMCtr="+SP_CTGY_NMCtr+"&SP_SUBCTGY_NMCtr="+SP_SUBCTGY_NMCtr;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表借用单
**/
function OpenSelectBorrowInstrumentTransItemDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectBorrowInstrumentTransItem.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表
**/
function OpenSelectInstrumentAtWarehouseDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectInstrumentAtWarehouse.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

function OpenSelectInstrumentAtWarehouseSingleDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectInstrumentAtWarehouseSingle.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表附件
**/
function OpenSelectInstrumentAccessoryAtWarehouseDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectInstrumentAccessoryAtWarehouse.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

/*选择备件对冲
**/
function OpenSelectSparePartChargeDialog(BaseUrl,idCtr,filt)
{
	var url = BaseUrl+"Common/Selector/SelectSparePartCharge.aspx?rdm=" + Math.random() + 
		"&idCtr=" + idCtr+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

///*选择仪器仪表型号
//**/
//function OpenSelectBorrowTransItemDialog(BaseUrl,cdCtr,idCtr,filt,nameCtr)
//{
//    var url = BaseUrl+"Common/Selector/SelectBorrowTransItem.aspx?rdm=" + Math.random() + 
//		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr;
//	OpenDialog(url, "480", "600")
//} 

/*选择人力管理参数
**/
function OpenSelectHeadCountParameterDialog(BaseUrl,idCtr,level1Ctr,level2Ctr,level3Ctr)
{
	var url = BaseUrl+"Common/Selector/SelectHeadCountParameter.aspx?rdm=" + Math.random() + 
		"&idCtr=" + idCtr + "&level1Ctr=" + level1Ctr + "&level2Ctr=" + level2Ctr + "&level3Ctr=" + level3Ctr;
	OpenDialog(url, "480", "600")
}

/*选择货位
**/
function OpenSelectLocationDialog(BaseUrl,cdCtr,idCtr,PARTY,TYPE)
{
	var url = BaseUrl+"Common/Selector/SelectLocation.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&PARTY=" + PARTY + "&TYPE=" + TYPE;
	OpenDialog(url, "480", "600")
}
/*选择货位（根据备件编号筛选推荐库位）
**/
function OpenSelectLocationDialogWithSP(BaseUrl,cdCtr,idCtr,PARTY,TYPE,SPNO)
{
	var url = BaseUrl+"Common/Selector/SelectLocation.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&PARTY=" + PARTY + "&TYPE=" + TYPE + "&SPNO=" + SPNO;
	OpenDialog(url, "480", "600")
}



/*选择货位
**/
function OpenSelectLocationsDialog(BaseUrl,selectCtr,PARTY,TYPE)
{
	var url = BaseUrl+"Common/Selector/SelectLocation.aspx?rdm=" + Math.random() + 
		 "&selectCtr=" + selectCtr + "&PARTY=" + PARTY + "&TYPE=" + TYPE;
	OpenDialog(url, "480", "600")
}


/*选择货位（根据备件编号筛选推荐库位）
**/
function OpenSelectLocationsDialogWithSP(BaseUrl,selectCtr,PARTY,TYPE,SPNO)
{
	var url = BaseUrl+"Common/Selector/SelectLocation.aspx?rdm=" + Math.random() + 
		 "&selectCtr=" + selectCtr + "&PARTY=" + PARTY + "&TYPE=" + TYPE + "&SPNO=" + SPNO;
	OpenDialog(url, "480", "600")
}

/*选择备件库存
**/
function OpenSelectStorageSparePartDialog(BaseUrl,cdCtr,idCtr,nameCtr,seriesCtr,locationCtr)
{
    var url = BaseUrl+"Common/Selector/SelectStorageSparePart.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&nameCtr=" + nameCtr + "&seriesCtr=" + seriesCtr + "&locationCtr=" + locationCtr;
	OpenDialog(url, "480", "600")
}

/*选择备件库存
**备件小分类筛选
**/
function OpenSelectStorageSparePartDialogWithSubCateAndOperation(BaseUrl,cdCtr,idCtr,nameCtr,seriesCtr,locationCtr,SubCate,Operation)
{
    var url = BaseUrl+"Common/Selector/SelectStorageSparePart.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&nameCtr=" + nameCtr + "&seriesCtr=" + seriesCtr + "&locationCtr=" + locationCtr 
		+ "&SubCate=" + SubCate + "&Operation="+Operation;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表供应商
**/
function OpenSelectInstrumentWithSupplierDialog(BaseUrl,INSTR_SUPP_IDCtr,SUPPLIER_NAMECtr,PRODUCT_CDCtr,PRODUCT_NAMECtr,ACCESSORYCtr,AGREE_PRICECtr,INSTR_CTGY_NMCtr,INSTR_CTGY_IDCtr,PURCHASE_TYPE_NMCtr,PURCHASE_TYPECtr,INSTR_ITEM_IDCtr,PURCHASE_TYPE)
{
	var url = BaseUrl+"Common/Selector/SelectInstrumentWithSupplier.aspx?rdm=" + Math.random() + 
		"&INSTR_SUPP_IDCtr=" + INSTR_SUPP_IDCtr +"&SUPPLIER_NAMECtr="+ SUPPLIER_NAMECtr+ 
		"&PRODUCT_CDCtr=" + PRODUCT_CDCtr +"&PRODUCT_NAMECtr="+ PRODUCT_NAMECtr+ 
		"&ACCESSORYCtr=" + ACCESSORYCtr +"&AGREE_PRICECtr="+ AGREE_PRICECtr+ 
		"&INSTR_CTGY_NMCtr=" + INSTR_CTGY_NMCtr +"&INSTR_CTGY_IDCtr="+ INSTR_CTGY_IDCtr+ 
		"&PURCHASE_TYPE_NMCtr=" + PURCHASE_TYPE_NMCtr +"&PURCHASE_TYPECtr="+ PURCHASE_TYPECtr+ 
		"&INSTR_ITEM_IDCtr="+ INSTR_ITEM_IDCtr +"&PURCHASE_TYPE="+ PURCHASE_TYPE;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表及价格和供应商
**/
function OpenSelectInstrumentSupplierDialog(BaseUrl,ctrId,ctrName)
{
    
	var url = BaseUrl+"Common/Selector/SelectInstrumentSupplier.aspx?rdm=" + Math.random() + 
		"&INSTR_SUPP_IDCtr=" + ctrId +"&SUPPLIER_NAMECtr="+ ctrName;
	OpenDialog(url, "480", "600")
}

/*选择备件（包括可替换的备件）
**/
function OpenSparePartSelectorDialog(BaseUrl,cdCtr,idCtr,filt,nameCtr)
{
    var url = BaseUrl+"Common/Selector/SparePartSelector.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr;
	OpenDialog(url, "480", "600")
} 

/*选择备件（包括可替换的备件）
**并通过备件小分类筛选
**/
function OpenSparePartSelectorDialogBySubCate(BaseUrl,cdCtr,idCtr,filt,nameCtr,SubCate)
{
    var url = BaseUrl+"Common/Selector/SparePartSelector.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr + "&SubCate=" + SubCate;
	OpenDialog(url, "480", "600")
} 

/*选择备件（包括可替换的备件）
**并通过备件小分类筛选
**/
function OpenSparePartSelectorDialogBySubCateDrd(BaseUrl,cdCtr,idCtr,filt,nameCtr,SubCate,drdCtr)
{
//alert(drdCtr);
    var url = BaseUrl+"Common/Selector/SparePartSelector.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr + "&SubCate=" + SubCate + "&drdCtr=" + drdCtr;
	OpenDialog(url, "480", "600")
} 

/*选择备件（增加返回SP_ID）8-29 by acns
**/
function OpenSparePartSelectorDialogwithSPID(BaseUrl,cdCtr,idCtr,filt,nameCtr,nameCtrlbl,spid)
{
    var url = BaseUrl+"Common/Selector/REQSparePartSelector.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr +
		"&nameCtrlbl=" + nameCtrlbl + "&spid=" + spid;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表
**/
function OpenSelectInstrumentDialog(BaseUrl,cdCtr,idCtr,filt,nameCtr)
{
    var url = BaseUrl+"Common/Selector/SelectInstrument.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr;
	OpenDialog(url, "480", "600")
} 

/*选择仪器仪表带功能类别
**/
function OpenSelectInstrumentWithCtgyDialog(BaseUrl,cdCtr,idCtr,filt,nameCtr,CtgyCtr)
{
    var url = BaseUrl+"Common/Selector/SelectInstrument.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr+ "&CtgyCtr=" + CtgyCtr;
	OpenDialog(url, "480", "600")
}

/*选择仪器仪表
**/
function OpenSelectInstrumentWithBrandDialog(BaseUrl,cdCtr,idCtr,nameCtr,brandidCtr,brandnmCtr,verifyperiodCtr)
{
    var url = BaseUrl+"Common/Selector/SelectInstrument.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&nameCtr=" + nameCtr+ "&brandidCtr=" + brandidCtr+ "&brandnmCtr=" + brandnmCtr+ "&verifyperiodCtr=" + verifyperiodCtr;
	OpenDialog(url, "480", "600")
} 

function OpenSelectWorkFlowRoleDialog(BaseUrl,WR_IDCtr,WR_NameCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectWorkFlowRole.aspx?rdm=" + Math.random() + 
		"&WR_IDCtr=" + WR_IDCtr+"&WR_NameCtr="+WR_NameCtr;
	OpenDialog(url, "480", "600")
}

//选择仪器仪表货位的放大镜 
//BaseUrl是URL的前缀，例："../../"；
//LOCATION_CDCtr是编号的控件名
//LOCATION_IDCtr是id的控件名
function OpenSelectInstrumentLocationDialog(BaseUrl,LOCATION_CDCtr,LOCATION_IDCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectInstrumentLocation.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + LOCATION_CDCtr+"&idCtr="+LOCATION_IDCtr;
	OpenDialog(url, "480", "600")
}

function OpenSelectInstrumentLocationsDialog(BaseUrl,selectCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectInstrumentLocation.aspx?rdm=" + Math.random() + 
		"&selectCtr=" + selectCtr;
	OpenDialog(url, "480", "600")
}

//选择单位的放大镜 
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是员工姓名的控件名；
function OpenSelectDepartmentDialog(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr)
{
	var url =  BaseUrl+"Common/Selector/SelectDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr;
	OpenDialog(url, "480", "600")
}

//根据选择的单位返回单位名称／ＩＤ／成本中心
function OpenSelectDepartmentCostDialog(BaseUrl,PARTY_IDCtr,PARTY_COSTCtr,PARTY_NAMECtr,PARTY_NameTxt,PARTY_CostTxt,BudgetTypeIdValue,BudgetYearIdValue,TxtElement)
{
	var url =  BaseUrl+"Common/Selector/SelectDepartmentCost.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_COSTCtr="+PARTY_COSTCtr+"&PARTY_NAMECtr="+PARTY_NAMECtr
		+"&PARTY_NameTxt="+PARTY_NameTxt+"&PARTY_CostTxt="+PARTY_CostTxt+"&BudgetTypeIdValue="+BudgetTypeIdValue+"&BudgetYearIdValue="+BudgetYearIdValue;
	//alert(url);
	OpenDialog(url, "530", "600")
	//window.open(url);
	return false;
}

//选择单位的放大镜 
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_NAMECtr是员工姓名的控件名；
function OpenSelectMaintDepartmentDialog(BaseUrl,PARTY_IDCtr,PARTY_NAMECtr)
{
	var url =  BaseUrl+"Common/Selector/SelectMaintDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_NAMECtr="+PARTY_NAMECtr;
	return OpenDialog(url, "480", "600");
}

//选择单位的放大镜 (带省的信息)
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是员工姓名的控件名；
function OpenSelectDepartmentWithProvinceDialog(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_PROVINCECtr,PROVINCE_NMCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr+"&PARTY_PROVINCECtr="+PARTY_PROVINCECtr+"&PROVINCE_NMCtr="+PROVINCE_NMCtr;
	OpenDialog(url, "480", "600")
}

//选择单位的放大镜 (带省的信息)
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是员工姓名的控件名；
function OpenSelectMIDepartmentWithProvinceDialog(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_PROVINCECtr,PROVINCE_NMCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectMIDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr+"&PARTY_PROVINCECtr="+PARTY_PROVINCECtr+"&PROVINCE_NMCtr="+PROVINCE_NMCtr;
	OpenDialog(url, "480", "600")
}

//选择单位的放大镜 (带省的信息)
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是名称的控件名；
//PARTY_PROVINCECtr是省份编号的下拉框控件名
//PROVINCE_NMCtr是省份名称控件
//PARTY_Address地址控件
//PARTY_Tel电话控件
//PARTY_Zip邮编控件
//PARTY_FAX传真
//PARTY2_IDCtr是id的控件名
//PARTY2_CODECtr是编号的控件名
//PARTY2_NAMECtr是名称的控件名；
//PARTY2_PROVINCECtr是省份编号的下拉框控件名
//PARTY2_PROVINCE_NMCtr是省份名称控件
//PARTY2_Address地址控件
//PARTY2_Tel电话控件
//PARTY2_Zip邮编控件
//PARTY2_FAX传真
function OpenSelectDepartmentWithProvinceDialogTWO(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_PROVINCECtr,PROVINCE_NMCtr,PARTY_Address,PARTY_Tel,PARTY_Zip,PARTY_FAX,
PARTY2_IDCtr,PARTY2_CODECtr,PARTY2_NAMECtr,PARTY2_PROVINCECtr,PARTY2_PROVINCE_NMCtr,PARTY2_Address,PARTY2_Tel,PARTY2_Zip,PARTY2_FAX)
{
    var url =  BaseUrl+"Common/Selector/SelectDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr+"&PARTY_PROVINCECtr="+PARTY_PROVINCECtr+"&PROVINCE_NMCtr="+PROVINCE_NMCtr
		+"&Party_Address="+PARTY_Address+"&Party_Tel="+PARTY_Tel+"&Party_Zip="+PARTY_Zip+"&Party_FAX="+PARTY_FAX
		+"&PARTY2_IDCtr=" + PARTY2_IDCtr+"&PARTY2_CODECtr="+PARTY2_CODECtr+"&PARTY2_NAMECtr="+PARTY2_NAMECtr+"&PARTY2_PROVINCECtr="+PARTY2_PROVINCECtr+"&PARTY2_PROVINCE_NMCtr="+PARTY2_PROVINCE_NMCtr
		+"&Party2_Address="+PARTY2_Address+"&Party2_Tel="+PARTY2_Tel+"&Party2_Zip="+PARTY2_Zip+"&Party2_FAX="+PARTY2_FAX;
	OpenDialog(url, "480", "600")
}

//选择单位的放大镜 (带省的信息)
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是员工姓名的控件名；
//Party_Address地址控件
//Party_Tel电话控件
//Party_Zip邮编控件
//Party_FAX传真
function OpenSelectDepartmentWithProvinceDialogAddress(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_PROVINCECtr,PROVINCE_NMCtr,Party_Address,Party_Tel,Party_Zip,Party_FAX)
{
	var url =  BaseUrl+"Common/Selector/SelectDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr+"&PARTY_PROVINCECtr="+PARTY_PROVINCECtr+"&PROVINCE_NMCtr="+PROVINCE_NMCtr
		+"&Party_Address="+Party_Address+"&Party_Tel="+Party_Tel+"&Party_Zip="+Party_Zip+"&Party_FAX="+Party_FAX;
	OpenDialog(url, "480", "600")
}


//选择单位的放大镜 (带部门类型的信息)
//BaseUrl是URL的前缀，例："../../"；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是部门名称的控件名；
//PARTY_TYPE_DESCCtr 是部门类型的控件名
function OpenSelectDepartmentWithTypeDialog(BaseUrl,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_TYPE_DESCCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectDepartment.aspx?rdm=" + Math.random() + 
		"&PARTY_IDCtr=" + PARTY_IDCtr+"&PARTY_CODECtr="+PARTY_CODECtr+"&PARTY_NAMECtr="+PARTY_NAMECtr+"&PARTY_TYPE_DESCCtr="+PARTY_TYPE_DESCCtr;
	OpenDialog(url, "480", "600")
}

//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
function OpenSelectUserDialog(BaseUrl,USER_IDCtr,USER_CDCtr,USER_NAMECtr,TELE_CODE1Ctr,EMAILCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&USER_CDCtr="+USER_CDCtr+"&USER_NAMECtr="+USER_NAMECtr+"&TELE_CODE1Ctr="+TELE_CODE1Ctr+"&EMAILCtr="+EMAILCtr;
	OpenDialog(url, "480", "600")
}

//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
function OpenSelectProcessUserDialog(BaseUrl, USER_IDCtr, USER_CDCtr, USER_NAMECtr, TELE_CODE1Ctr, EMAILCtr, EnglishNameCtr) {
    var url = BaseUrl + "_Vela3/Common/Selector/SelectProcessUser.aspx?rdm=" + Math.random() +
		"&USER_IDCtr=" + USER_IDCtr + "&USER_CDCtr=" + USER_CDCtr + "&USER_NAMECtr=" + USER_NAMECtr + "&TELE_CODE1Ctr=" + TELE_CODE1Ctr + "&EMAILCtr=" + EMAILCtr + "&EnglishNameCtr=" + EnglishNameCtr;
    OpenDialog(url, "500", "600")
}
//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_NAMECtr是员工姓名的控件名；

function vela3OpenSelectUserDialog(BaseUrl, USER_IDCtr, USER_CDCtr, USER_NAMECtr, TELE_CODE1Ctr, EMAILCtr) {

    var url = BaseUrl + "_Vela3/Common/Selector/SelectSingleProcessUser.aspx?rdm=" + Math.random() +
		"&USER_IDCtr=" + USER_IDCtr + "&USER_CDCtr=" + USER_CDCtr + "&USER_NAMECtr=" + USER_NAMECtr + "&TELE_CODE1Ctr=" + TELE_CODE1Ctr + "&EMAILCtr=" + EMAILCtr;
    OpenDialog(url, "550", "750")
}
//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_NAMECtr是员工姓名的控件名；

function vela3OpenSelectSingleUserDialog(BaseUrl, USER_IDCtr, USER_CDCtr, USER_NAMECtr, TELE_CODE1Ctr, EMAILCtr) {

    var url = BaseUrl + "_Vela3/Common/Selector/SelectSingleUser.aspx?rdm=" + Math.random() +
		"&USER_IDCtr=" + USER_IDCtr + "&USER_CDCtr=" + USER_CDCtr + "&USER_NAMECtr=" + USER_NAMECtr + "&TELE_CODE1Ctr=" + TELE_CODE1Ctr + "&EMAILCtr=" + EMAILCtr;
    OpenDialog(url, "610", "780")
}
//选择多个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
function OpenSelectProcessUsersDialog(BaseUrl, USER_IDCtr,USER_NAMECtr) {
    var url = BaseUrl + "_Vela3/Common/Selector/SelectProcessUsers.aspx?rdm=" + Math.random() +
		"&USER_IDCtr=" + USER_IDCtr + "&USER_NAMECtr=" + USER_NAMECtr;
    OpenDialog(url, "550", "700")
} 
//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
//AccountCtr是Account的控件名
function OpenSelectUserDialog(BaseUrl, USER_IDCtr, USER_CDCtr, USER_NAMECtr, TELE_CODE1Ctr, EMAILCtr, AccountCtr) {
    var url = BaseUrl + "_Vela3/Common/Selector/SelectProcessUser.aspx?rdm=" + Math.random() +
		"&USER_IDCtr=" + USER_IDCtr + "&USER_CDCtr=" + USER_CDCtr + "&USER_NAMECtr=" + USER_NAMECtr + "&TELE_CODE1Ctr=" + TELE_CODE1Ctr + "&EMAILCtr=" + EMAILCtr + "&AccountCtr=" + AccountCtr;
    OpenDialog(url, "480", "600")
}

//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
//PARTY_IDCtr是id的控件名
//PARTY_CODECtr是编号的控件名
//PARTY_NAMECtr是名称的控件名；
//PARTY_PROVINCECtr是省份编号的下拉框控件名
//PROVINCE_NMCtr是省份名称控件
//PARTY_Address地址控件
//PARTY_Tel电话控件
//PARTY_Zip邮编控件
//PARTY_FAX传真
function OpenSelectUserReturnDepDialog(BaseUrl,USER_IDCtr,USER_CDCtr,USER_NAMECtr,TELE_CODE1Ctr,EMAILCtr,PARTY_IDCtr,PARTY_CODECtr,PARTY_NAMECtr,PARTY_PROVINCECtr,PROVINCE_NMCtr,PARTY_AddressCtr,PARTY_TelCtr,PARTY_ZipCtr,PARTY_FAXCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&USER_CDCtr="+USER_CDCtr+"&USER_NAMECtr="+USER_NAMECtr+"&TELE_CODE1Ctr="+TELE_CODE1Ctr+"&EMAILCtr="+EMAILCtr
		+"&PARTYIDCtr=" + PARTY_IDCtr + "&PARTY_CODECtr=" + PARTY_CODECtr + "&PARTYNAMECtr=" + PARTY_NAMECtr + "&PARTY_PROVINCECtr=" + PARTY_PROVINCECtr + "&PROVINCE_NMCtr=" + PROVINCE_NMCtr + "&PARTY_AddressCtr=" + PARTY_AddressCtr + "&PARTY_TelCtr=" + PARTY_TelCtr + "&PARTY_ZipCtr=" + PARTY_ZipCtr + "&PARTY_FAXCtr=" + PARTY_FAXCtr;
	OpenDialog(url, "480", "600")
}


//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
//DepId是默认筛选的部门ＩＤ
function OpenSelectUserByDepIDDialog(BaseUrl,USER_IDCtr,USER_CDCtr,USER_NAMECtr,TELE_CODE1Ctr,EMAILCtr,DepId)
{
	var url =  BaseUrl+"Common/Selector/SelectUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&USER_CDCtr="+USER_CDCtr+"&USER_NAMECtr="+USER_NAMECtr+"&TELE_CODE1Ctr="+TELE_CODE1Ctr+"&EMAILCtr="+EMAILCtr+"&DepId="+DepId;
	OpenDialog(url, "480", "600")
}

//探亲费用里原则员工放大镜，只需要返回员工ＩＤ和ＮＡＭE;指定员工所属部门了．
function OpenSelectFamilyUserDialog(BaseUrl,USER_IDCtr,PartyId)
{
	var url =  BaseUrl+"Common/Selector/SelectFamilyUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&PartyId="+PartyId;
	OpenDialog(url, "480", "600")
	//window.open(url);
}
//预算管理A培人员选择员工放大镜
function OpenSelectAUserDialog(BaseUrl,USER_IDCtr,PartyId)
{
	var url =  BaseUrl+"Common/Selector/SelectAUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&PartyId="+PartyId;
	OpenDialog(url, "480", "600")
	//window.open(url);
}
//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//USER_IDCtr是id的控件名
//USER_CDCtr是编号的控件名
//USER_NAMECtr是员工姓名的控件名；
//TELE_CODE1Ctr是电话的控件名；
//EMAILCtr是电子邮件的控件名；
//PARTYIDCtr是部门ＩＤ；
//PARTYNAMECtr是部门名称；
function OpenSelectUserWithPartyDialog(BaseUrl, USER_IDCtr, USER_CDCtr, USER_NAMECtr, TELE_CODE1Ctr, EMAILCtr, PARTYIDCtr, PARTYNAMECtr) 
{
	var url =  BaseUrl+"Common/Selector/SelectUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&USER_CDCtr="+USER_CDCtr+"&USER_NAMECtr="+USER_NAMECtr+"&TELE_CODE1Ctr="+TELE_CODE1Ctr+"&EMAILCtr="+EMAILCtr+"&PARTYIDCtr="+PARTYIDCtr+"&PARTYNAMECtr="+PARTYNAMECtr;
	OpenDialog(url, "480", "800")
}
function OpenSelectRoleDialog(BaseUrl,ROLE_IDCtr,ROLE_CDCtr,ROLE_NAMECtr)
{
	var url =  BaseUrl+"Common/Selector/SelectRole.aspx?rdm=" + Math.random() + 
		"&ROLE_IDCtr=" + ROLE_IDCtr+"&ROLE_CDCtr="+ROLE_CDCtr+"&ROLE_NAMECtr="+ROLE_NAMECtr;
	OpenDialog(url, "480", "600")
}
function OpenSelectUserTimesheetDialog(BaseUrl,USER_IDCtr,USER_CDCtr,USER_NAMECtr,TELE_CODE1Ctr,EMAILCtr,PARTYIDCtr,PARTYNAMECtr, UserID)
{
	var url =  BaseUrl+"Common/Selector/TimesheetSelectUser.aspx?rdm=" + Math.random() + 
		"&USER_IDCtr=" + USER_IDCtr+"&USER_CDCtr="+USER_CDCtr+"&USER_NAMECtr="+USER_NAMECtr+"&TELE_CODE1Ctr="+TELE_CODE1Ctr+"&EMAILCtr="+EMAILCtr+"&HR_PARTY_IDCtr="+PARTYIDCtr+"&PARTY_NAMECtr="+PARTYNAMECtr+"&USER_ID="+UserID;
	//alert(url);
	OpenDialog(url, "470", "800")
}


//选择多个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；

//UserIdCtr是id的控件名,得到的是个序列，中间用“,”分割；
//UserNameCtr是员工姓名的控件名,得到的是个序列，中间用“,”分割。与ID一一对应；

//mancount最多选择人数，如果给值，则默认最多70个人；

//idvalue和namevalue是用来传入原先选定的人员序列，通常是IdCtr和EmployeeNameCtr的值。如果不需要则给空值；
function OpenSelectMultiUserDialog(BaseUrl,UserIdCtr,UserNameCtr,mancount,idvalue,namevalue)
{
	var url =  BaseUrl+"Common/Selector/SelectMultiUser.aspx?rdm=" + Math.random() +"&UserIdCtr=" + UserIdCtr + "&UserNameCtr=" + UserNameCtr + "&mancount="+mancount+"&idvalue="+escape(idvalue)+"&namevalue="+escape(namevalue);
	OpenDialog(url, "480", "600")
}

function OpenDialog(url, height, width) {
    if (url.indexOf("Math") > -1) {
        return window.showModalDialog(url, document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");
    }
    else if (url.indexOf("?") > -1) {
        return window.showModalDialog(url + "&rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");
    }
    else {
        return window.showModalDialog(url + "?rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");

    }


}

function OpenDialog_OnResize(url, height, width) {
    if (url.indexOf("Math") > -1) {
        return window.showModalDialog(url, document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: yes; status: No;");
    }
    else if (url.indexOf("?") > -1) {
        return window.showModalDialog(url + "&rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: yes; status: No;");
    }
    else {
        return window.showModalDialog(url + "?rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: yes; status: No;");

    }


}

function OpenLessDialog(url, height, width) {
    if (url.indexOf("Math") > -1) {
        return window.showModelessDialog(url, document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");
    }
    else if (url.indexOf("?") > -1) {
    return window.showModelessDialog(url + "&rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");
    }
    else {
        return window.showModelessDialog(url + "?rmd=" + Math.random(), document, "dialogHeight: " + height + "px; dialogWidth: " + width + "px;edge: Raised; center: Yes; help: No; resizable: No; status: No;");

    }


}

/*打开新窗口调用以下函数-*/
function OpenSmallWin(url)
{
	OpenWin(url,'', '350', '600');
}
function OpenBigWin(url) 
{
	OpenWin(url,'', '620', '850');
}
function OpenLongWin(url) {
    OpenWin(url, '', '450', '800');
}
function OpenWin(url, name, height, width)
{
	var left = Get_Center(width,'x');	
	var top = Get_Center(height,'y');
	if (top > 30)
	{
		top = top - 30;
	}
	window.open(url,name,"height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=no");
}
function OpenNewWin(url, name, height, width)
{
	var left = Get_Center(width,'x');	
	var top = Get_Center(height,'y');
	if (top > 30)
	{
		top = top - 30;
	}
	window.open(url,name,"height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes");
}
function OpenNewWinSimple(url, name, height, width) {
    var left = Get_Center(width, 'x');
    var top = Get_Center(height, 'y');
    if (top > 30) {
        top = top - 30;
    }
    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
}
function OpenNewWinSimplest(url, name, height, width) {
    var left = Get_Center(width, 'x');
    var top = Get_Center(height, 'y');
    if (top > 30) {
        top = top - 30;
    }
    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=no");
}
function Get_Center(size, side)
{
	self.y_center=(parseInt(screen.height/2));
	self.x_center=(parseInt(screen.width/2));
	center = eval('self.'+side+'_center-('+size+'/2);');
	return(parseInt(center));
}

//PROJECT 新增项目成员时打开选择窗口 ProjectMember.ascx
function OpenSelectProjectMemberDialog(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"Common/Selector/SelectProjectMember.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

//A培里选择合同的窗口
function OpenSelectContractInfoDialog(BaseUrl,ctrId)
{
	var url = BaseUrl+"Common/Selector/SelectContractInfo.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId;
	OpenDialog(url, "480", "600")
	//window.open(url);
}

////外包申请/变更申请,时选择合同的窗口，只允许显示到省的合同
//function OpenSelectContractForSCDialog(BaseUrl,ctrId,Type,RequetorID)
//{
//alert('okdd');
//	var url = BaseUrl+"Common/Selector/SelectContractForSC.aspx?Type="+Type+"&rdm=" + Math.random() + 
//		"&IdCtr=" + ctrId+"&RequetorID="+RequetorID;
//	//OpenDialog(url, "480", "800")
//}


//外包申请/变更申请,时选择合同的窗口，只允许显示到省的合同
function OpenSelectContractForSCDialogN(BaseUrl,ctrId,Type,RequetorID)
{
 
	var url = BaseUrl+"Common/Selector/SelectContractForSC.aspx?Type="+Type+"&rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&RequetorID="+RequetorID;
	 OpenDialog(url, "480", "800")
}


//增加工程队,时选择供应商的窗口
function OpenSelectVendorForSCDialog(BaseUrl,ctrId,Type)
{
	var url = BaseUrl+"Common/Selector/SelectVendor.aspx?Type="+Type+"&rdm=" + Math.random() + 
		"&IdCtr=" + ctrId;
	OpenDialog(url, "480", "600")
}

//工程项目的项目进度预测变更时 供EquipmentProjectProgress.ascx调用
function OpenForecastChangeReason(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"ISEMIS/Project/ProjectForecastChange.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	return OpenDialog(url, "275", "480");
}

//工程项目的项目进度预测变更历史查看时 供EquipmentProjectProgress.ascx调用
function OpenForecastChangeList(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"ISEMIS/Project/ForecastChangeList.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}
//工程项目的项目进度预测变更历史查看时 供EquipmentProjectProgress.ascx调用
function Vela3OpenForecastChangeList(BaseUrl, ctrId, filt) {
    var url = BaseUrl + "Project/ForecastChangeList.aspx?rdm=" + Math.random() +
		"&IdCtr=" + ctrId + "&ID=" + filt;
    OpenDialog(url, "500", "900")
}

//工程项目的项目进度实际日期历史查看时 供EquipmentProjectProgress.ascx调用
function OpenActualChangeList(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"ISEMIS/Project/ActualChangeList.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "480", "600")
}

//工程项目的项目进度实际日期OTIS时 供EquipmentProjectProgress.ascx调用
function OpenActualChangeReason(BaseUrl,ctrId,Id)
{
	var url = BaseUrl+"ISEMIS/Project/ActualTimeChange.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&ID="+Id;
	OpenDialog(url, "278", "480")
}

//工程项目的项目进度基准变更历史查看时 供EquipmentProjectProgress.ascx调用
function OpenEstimateChangeList(BaseUrl,ctrId,filt)
{
	var url = BaseUrl+"ISEMIS/Project/EstimateChangeList.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	window.open(url,'', "height=480,width=600,left=200,top=100,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=no")
}


//工程项目的项目进度基准变更申请时 供EquipmentProjectProgress.ascx调用
function OpenBaselineAlterationApply(BaseUrl,ctrId,Id)
{
	var url = BaseUrl+"ISEMIS/Project/BaselineAlterationApply.aspx?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&ID="+Id;
	OpenDialog(url, "420", "600")
}

//外包外协的供应商管理的新增时 供VendorManagement.aspx调用
function OpenAddNewForVendorManagement(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "358", "600")
}

//外包外协的工程師管理的新增时 供EngineerSearch.aspx调用
function OpenAddNewForEngineer(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "500", "600")
}
//外包外协的框架价格管理的新增时 供FramPriceList.aspx调用
function OpenAddNewForFramPriceList(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "660", "650")
}
//外包外协的工程师导入证书时 供SC_EngineerSearch.aspx调用
function OpenImportCertificatePop(BaseUrl,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() ;
	OpenDialog(url, "200", "560")
}
//外包外协的工程队管理的新增时 供TeamDetailInfo.aspx调用
function OpenAddNewFrameForTeamFrameManagement(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&IdCtr=" + ctrId+"&filt="+filt;
	OpenDialog(url, "330", "530")
}

//外包外协的外协工程师的新增时 供VendorManagement.aspx调用
function OpenAddNewForVendorManagementPop(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&ID=" + ctrId+"&CD="+filt;
	OpenDialog(url, "598", "600")
}

//外包外协的外协工程师导入时 供OSEngineerUpLoad.aspx调用
function OpenOSEngineerUpLoadRulePop(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&ID=" + ctrId+"&CD="+filt;
	OpenDialog(url, "400", "600")
}
//外包外协 导入excel时 供OutSourcingUpLoad.aspx调用
function OpenOutSourcingUpLoadRulePop(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Outsourcing/"+windowUrl+"?rdm=" + Math.random() + 
		"&ID=" + ctrId+"&UPType="+filt;
	OpenDialog(url, "400", "600")
}

//Baseline列表查看时 供EstimateChangeList.aspx调用
function OpenViewHistoryPop(BaseUrl,ctrId,filt,windowUrl)
{
	var url = BaseUrl+"ISEMIS/Project/"+windowUrl+"?rdm=" + Math.random() + 
		"&Request_ID=" + ctrId+"&CD="+filt;
	window.open(url,'', "height=398,width=600,left=200,top=100,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=no")
}


//关闭窗口
function Close()
{
	if (window.parent != null)
		window.parent.close();
	else
		window.close();
}
		
//*按回车或空格时关闭按钮不处理*/
function NoClose()
{
	if(window.event.keyCode == 13 || window.event.keyCode == 32)
	{
		window.event.keyCode = 9;
	}
}

//外协用人申请－＞增加申请的人员
function OpenOSAddEmployee(BaseUrl,ctrId)
{
	var url = BaseUrl+"?rdm=" + Math.random() ;
	OpenDialog(url, "300", "250")
	//window.open(url);
}

/*选择Case 9-21 by acns
**/
function OpenCase(BaseUrl,cdCtr,idCtr)
{
    var url = BaseUrl+"Common/Selector/SelectCase.aspx?cdCtr=" + cdCtr +
     "&idCtr=" + idCtr;// + "&filt=" + filt + "&nameCtr=" + nameCtr +
		//"&nameCtrlbl=" + nameCtrlbl + "&spid=" + spid;
	OpenDialog(url, "480", "600")
}

//验证数字型
//周志国
function checknum(thisobj)
	{
		var n=thisobj.value;
		if(isNaN(n)==true){
			thisobj.select();
			thisobj.focus();
			return false;
		}
		return true;
	}
//判断非空
 function isEmpty(thisobj)
{  
	return ((thisobj.value == null) || (thisobj.value.length == 0))
}/*根据备件大分类选择小分类并提示警告信息
** 11-11 by zhangqiang
**/
var selectValue = '';
function SetSubCategoryAndWarn(msg,count)
{
    if(count > 0)
    {
        if(confirm(msg) == true)
        {
            __doPostBack('ddlCategory','');
        }
        else
        {
            for(var i=0; i<document.getElementById('ddlCategory').options.length; i++)
            {
                if(document.getElementById('ddlCategory').options[i].value == selectValue)
                {
                    document.getElementById('ddlCategory').options[i].selected = true;
                }
                else
                {
                    document.getElementById('ddlCategory').options[i].selected = false;
                }
            }
            return false;
        }
    }
    else
    {
        __doPostBack('ddlCategory','');
    }
}

function GetCategorySelected()
{
    for(var i=0; i<document.getElementById('ddlCategory').options.length; i++)
    {
        if(document.getElementById('ddlCategory').options[i].selected == true)
        {
            selectValue = document.getElementById('ddlCategory').options[i].value;
            break;
        }
    }
}

function SetSubCategoryAndWarnWithId(msg,ctrlId,count)
{
    if(count > 0)
    {

        if(confirm(msg) == true)
        {
            __doPostBack(ctrlId.id,''); 
        }
        else
        {
            for(var i=0; i<ctrlId.options.length; i++)
            {
                if(ctrlId.options[i].value == selectValue)
                {
                    ctrlId.options[i].selected = true;
                }
                else
                {
                    ctrlId.options[i].selected = false;
                }
            }
            return false;
        }
    }
    else
    {
        __doPostBack(ctrlId.id,''); 
    }
}

function GetCategorySelectedWithId(ctrlId)
{
    for(var i=0; i<ctrlId.options.length; i++)
    {
        if(ctrlId.options[i].selected == true)
        {
            selectValue = ctrlId.options[i].value;
            break;
        }
    }
}
/* 根据备件小分类id获取选中的小分类
**/
function ReturnSubCategoryWithId(ctrlId)
{
    var SubCtrl = document.getElementById(ctrlId);
    for(var i=0; i<SubCtrl.options.length; i++)
    {
        if(SubCtrl.options[i].selected == true)
        {
            return SubCtrl.options[i].text;
        }
    }
}

function ViewOrderItemProcessInfo(CtrlID)
{
    var url = "ViewOrderItemProcessInfo.aspx?rdm=" + Math.random() + 
		"&id=" + document.all[CtrlID].value;
	OpenDialog(url, "480", "600")
}
/*
function Sp2GetSingleSparepartDialog(BaseUrl,fillSP2_BASE_DB_ID,fillSP2_CODE,fillLBLSP2_NAME,fillTXTSP2_NAME,fillLBLCATEGORY_NAME,fillTXTCATEGORY_NAME,fillLBLCATEGORY_NAME_SUB,fillTXTCATEGORY_NAME_SUB,fillCOUNT)
{
    var url = BaseUrl+"Common/SparepartDialog/SelectSingleSparepart.aspx?rdm=" + Math.random() 
		+ "&fillid=" + fillSP2_BASE_DB_ID 
		+ "&fillcode=" + fillSP2_CODE 
		+ "&filllblname=" + fillLBLSP2_NAME
		+ "&filltxtname=" + fillTXTSP2_NAME
        + "&filllblcn=" + fillLBLCATEGORY_NAME
        + "&filltxtcn=" + fillTXTCATEGORY_NAME
		+ "&filllblcns=" + fillLBLCATEGORY_NAME_SUB
		+ "&filltxtcns=" + fillTXTCATEGORY_NAME_SUB
		+ "&fillcount=" + fillCOUNT;
	OpenDialog(url, "480", "600")
}
*/
/*
function OpenSparePartSelectorDialogBySubCate(BaseUrl,cdCtr,idCtr,filt,nameCtr,SubCate)
{
    var url = BaseUrl+"Common/Selector/SparePartSelector.aspx?rdm=" + Math.random() + 
		"&cdCtr=" + cdCtr + "&idCtr=" + idCtr + "&filt=" + filt + "&nameCtr=" + nameCtr + "&SubCate=" + SubCate;
	OpenDialog(url, "480", "600")
} 

*/

//选择单个员工放大镜 
//BaseUrl是URL的前缀，例："../../"；
//IDCtr是id的控件名
function OpenSelectInvoiceBillDialog(BaseUrl, IDCtr)
{
	var url =  BaseUrl+"Common/Selector/SelectSparePartInvoiceBill.aspx?rdm=" + Math.random() + "&IDCtr=" + IDCtr;
	OpenDialog(url, "480", "600");
}

//打开新的窗口
function openNewWindow(url, name, height, width) {
    //add by fjShen 20090617
    if (!name) name = "_blank";
    if (!height) height = h;
    if (!width) width = w;
    var left = (screen.availWidth - width) / 2;
    //var top = (screen.availHeight - height)/2;
    var top = 3;

    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
}

function openNewWindowN(url, name, height, width,top) {
    //add by fjShen 20090617
    if (!name) name = "_blank";
    if (!height) height = h;
    if (!width) width = w;
    var left = (screen.availWidth - width) / 2;
    //var top = (screen.availHeight - height)/2; 

    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
}
function openWindowN(url, name, width,top) {
    //add by fjShen 20090617
    if (!name) name = "_blank";
   // if (!height) height = =;
    if (!width) width = w;
    var left = (screen.availWidth - width) / 2;
    var height=screen.availHeight -40
  

    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
     
}

function RefreshOpenerGrid(element)
{
    if (element != null) {
        if (document.all && typeof (document.all) == "object")   //IE
        {
            element.click();
        }
        else {
            if (element.tagName.toLowerCase() == "a") {
                eval(element.href);
            }
            else if (element.tagName.toLowerCase() == "input") {
                eval("element.click()");
            }
            else {
                var e = document.createEvent('MouseEvent');
                e.initEvent('click', true, false);
                elemID.dispatchEvent(e);
            }
        }
    }
}	

//打开新的窗口
function openNewWindow_New(url, name, height, width) {
    var left = (screen.availWidth - width) / 2;
    var top = 30;
    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
} 
//打开新的窗口
function openWin_New(url, name, height, width) 
{
    var left = (screen.availWidth - width) / 2;
    var top = 30;
    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
}

//打开新的窗口
function openNewWindow_IsScroll(url, name, height, width,scrollStr) {
    var left = (screen.availWidth - width) / 2;
    var top = 30;
    window.open(url, name, "height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",scrollbars=" + scrollStr + ",status=no,toolbar=no,menubar=no,location=no,resizable=no");
}
